# For_exam.py

class Car():
   def __init__(self, model, year, color, price, mile):
      self.model = model
      self.year = year
      self.color = color
      self.price = price
      self.mile = mile
    
   def display_mile(self):
      print("跑了" + str(self.mile) + "公里")
    
   def display_price(self):
      print("价格：" + str(self.price) + "元")
   def display_color(self):
       print("颜色：" + self.color)   
   def display_year_(self):
       print("有"+self.year+"年")
    
class Employee():
   def __init__(self,Fristname,lastname,paids):
      self.Fristname = Fristname
      self.lastname = lastname
      self.paids = paids
   
   def give_raise(self):
      self.paids = self.paids +50000


class City():
   def __init__(self,City,Country):
      self.City = City
      self.Country = Country

   def display_city(self):
      return self.City,self.Country
      

class magician():    
   # 8-9 魔术师
   def show_magicians(magicians):
      for magician in magicians:
         print(magician)

   magicians = ['Merlin', 'Houdini', 'David Copperfield']
   show_magicians(magicians)

   # 8-10 了不起的魔术师
   def make_great(magicians):
      great_magicians = []
      for magician in magicians:
         great_magician = magician + " the Great"
         great_magicians.append(great_magician)
      return great_magicians

   # 修改原始列表
   magicians = make_great(magicians)

   # 调用 show_magicians() 确认修改
   show_magicians(magicians)

   # 8-11 不变的魔术师
   original_magicians = ['Merlin', 'Houdini', 'David Copperfield']
   modified_magicians = make_great(original_magicians[:])  # 使用切片创建原列表的副本

   # 调用 show_magicians() 分别确认两个列表
   print("\nOriginal Magicians:")
   show_magicians(original_magicians)

   print("\nModified Magicians:")
   show_magicians(modified_magicians)





